package com.qf.hospital.mapper;

import com.qf.hospital.entity.Register;
import com.qf.hospital.entity.RegisterExample;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface RegisterMapper {
    long countByExample(RegisterExample example);

    int deleteByExample(RegisterExample example);

    int deleteByPrimaryKey(Integer registerId);

    int insert(Register record);

    int insertSelective(Register record);

    List<Register> selectByExample(RegisterExample example);

    Register selectByPrimaryKey(Integer registerId);

    int updateByExampleSelective(@Param("record") Register record, @Param("example") RegisterExample example);

    int updateByExample(@Param("record") Register record, @Param("example") RegisterExample example);

    int updateByPrimaryKeySelective(Register record);

    int updateByPrimaryKey(Register record);

    @Select("SELECT COUNT(0) FROM `register` WHERE DATE_FORMAT(start_time,'%Y-%m-%d')=DATE_FORMAT(CURTIME(),'%Y-%m-%d') AND state!=0")
    long findRegisterByCurrent();
}